<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="OpenLS.UI.Themes.CheckBoxResources"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:oui="clr-namespace:OpenLS.UI"                  
    >
    <Style TargetType="CheckBox" x:Key="{x:Static oui:Styles.RibbonCheckBoxStyleKey}">
        <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static oui:OfficeBrushes.TextForegroundKey}}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>

        <Setter Property="Panel.Background" Value="{DynamicResource {x:Static oui:OfficeBrushes.RibbonCheckBoxBackgroundKey}}"/>
        <Setter Property="Border.BorderBrush" Value="{DynamicResource {x:Static oui:OfficeBrushes.RibbonCheckBoxBorderBrushKey}}" />
        <Setter Property="Border.BorderThickness" Value="1">
        </Setter>
        <Setter Property="FrameworkElement.FocusVisualStyle">
            <Setter.Value>
                <Style TargetType="IFrameworkInputElement">
                    <Setter Property="Control.Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Rectangle Margin="1,1,1,1" SnapsToDevicePixels="True" Stroke="#FF000000" StrokeDashArray="1 2" StrokeThickness="1" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <BulletDecorator Background="#00FFFFFF" SnapsToDevicePixels="True">
                        <BulletDecorator.Bullet>
                            <Border BorderThickness="1" Background="{TemplateBinding Panel.Background}" Name="bd1" BorderBrush="#FFABC1DE">
                                <Border BorderThickness="1" Background="{TemplateBinding Panel.Background}" Name="bd2" BorderBrush="#FFF4F4F4">
                                    <Border BorderThickness="1" Name="bd3" BorderBrush="#FFA2ACB9">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="1,1" StartPoint="0,0" >
                                                <GradientStop Offset="0" Color="#FFCACFD5" />
                                                <GradientStop Offset="1" Color="#FFF6F6F6" />
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <Path Data="M0,4 L 3,7 L 7,0" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.3" Name="path"
                                Loaded="path_Loaded">
                                        </Path>
                                    </Border>
                                </Border>
                            </Border>
                        </BulletDecorator.Bullet>
                        <ContentPresenter Margin="{TemplateBinding Control.Padding}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" RecognizesAccessKey="True" Content="{TemplateBinding ContentControl.Content}" />
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ContentControl.HasContent" Value="True">
                            <Setter Property="FrameworkElement.FocusVisualStyle">
                                <Setter.Value>
                                    <Style TargetType="IFrameworkInputElement">
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="#FF000000" StrokeDashArray="1 2" StrokeThickness="1" />
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Control.Padding" Value="2,0,0,0"/>
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled" Value="False">
                            <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            <Setter Property="BorderBrush" TargetName="bd1" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            <Setter Property="BorderBrush" TargetName="bd3" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            <Setter Property="Stroke" TargetName="path" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" TargetName="bd1" Value="#FF5577A3"/>
                            <Setter Property="BorderBrush" TargetName="bd3" Value="#FFFAD57A"/>
                            <Setter Property="Background" TargetName="bd3">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="1,1" StartPoint="0,0" >
                                        <GradientStop Offset="0" Color="#FFFCE7AF" />
                                        <GradientStop Offset="1" Color="#FFFEF8E7" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter Property="Visibility" TargetName="path" Value="Hidden"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>